import axios from 'axios';
let base_url = "http://localhost:80";
// let page1='"a='+data.a+'&b='+data.b+'"';
const instance = axios.create({
    baseURL: 'http://localhost:80/',
    timeout: 3*1000,
    headers: {'X-Custom-Header': 'foobar'}
  });
export function get(url,params){
    return axios.get(base_url+url,{params});
}
export function post(url,data){
    let page =data
    return axios.post('api/UserQuery/findbyusername',"name="+data.name+"&a="+data.a+"&b="+data.b,{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
}

// export function post(url,data){
//     console.log(instance.baseURL)
//     console.log('aaa')
//     console.log(base_url+url)
//     console.log(data)
//     let page =data
//     return axios.post('api/articles/name1',"title="+data.title+"&currentPage="+data.currentPage+"&pageSize="+data.pageSize,{
//         headers:{
//            'content-type': 'application/x-www-form-urlencoded',
//         }
//     });
// }
export function del(url){
    return axios.delete(base_url+url);
}
export function put(url,data){
    return axios.put(base_url+url,data);
}


